package com.gw2.gw2world;


import com.gw2.gw2world.controller.EventDownloader;
import com.gw2.gw2world.controller.OnTaskCompleted;
import com.gw2.gw2world.controller.Tools;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.widget.TextView;

@Deprecated
public class MetaEventServerStatusActivity extends Activity implements OnTaskCompleted {
	@SuppressWarnings("unused")
	private static final String TAG="MetaEventServerStatusActivity";
	private EventDownloader downloader;
	private Handler  handler=new Handler();
	private Runnable task;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Tools.forceLocale(this);
		setContentView(R.layout.temple_dungeon_detail);
		TextView tv_event=(TextView)findViewById(R.id.tv_td_event_name);
		tv_event.setText(getIntent().getExtras().getInt("event_name"));
		tv_event.setCompoundDrawablesWithIntrinsicBounds(getIntent().getExtras().getInt("event_drawable"), 0, 0, 0);
		((TextView)findViewById(R.id.tv_td_map)).setText(getIntent().getExtras().getString("map_name",""));
	}
	@Override
	protected void onPause() {
		if(downloader!=null) downloader.cancel(true);
		handler.removeCallbacksAndMessages(null);
		Tools.unlockScreen(this);
		super.onPause();
	}
	@Override
	protected void onResume() {
		Tools.lockScreenFromPreferences(this);
		if(downloader!=null && task!=null) start();
		super.onResume();
	}
	private void start() {
		downloader=new EventDownloader(this,"en",0,0,0,false); //
		//downloader.setServer(0);
		//downloader.setGuesting(true);
		downloader.setAllServers(true);
		downloader.setOnTaskCompletedListener(this);
		//downloader.setMap(map_id);
		downloader.execute();
	}
	@Override
	public void onTaskCompleted() {
		
	}
}
